package main

import (
	"github.com/gin-gonic/gin"
	"message-queue_0826/config"
	"message-queue_0826/inits"
	"message-queue_0826/pkg"
	"message-queue_0826/routes"
)

func main() {

	config.Init()

	inits.InitMysql()
	inits.InitRedis()

	// 1.创建路由
	r := gin.Default()

	//消费消息
	rabbitmq := pkg.NewRabbitMQSimple("" +
		"kuteng")
	go rabbitmq.ConsumeSimple()

	// 2.绑定路由规则，执行的函数
	// gin.Context，封装了request和response
	routes.LoadRouter(r)

	// 3.监听端口，默认在8080
	// Run("里面不指定端口号默认为8080")
	r.Run(":8456")
}

//binding:"required"
